package action;

import persistence.InstituicaoDAO;
import model.Instituicao;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class CadastroInstituicaoAction extends ActionSupport {

	private Instituicao instituicao; //TODO a instituicao eh criada automaticamente?

	public Instituicao getInstituicao() {
		return instituicao;
	}

	public void setInstituicao(Instituicao instituicao) {
		this.instituicao = instituicao;
	}

	public String salvar() {
		System.out.println("############## save Instituicao");		
		
		System.out.println("Inst: " + instituicao.toString()); //TODO				

		InstituicaoDAO.getInstance().salvar(instituicao);

		return SUCCESS;
	}

}
